import request from '@/utils/request'

// 查询列表
export function listManagement(query) {
    return request({
        url: '/business/handleAccount/list',
        method: 'get',
        params: query
    })
}

// 查询详细
export function getManagement(phoneId) {
    return request({
        url: '/business/handleAccount/' + phoneId,
        method: 'get'
    })
}

// 新增
export function addManagement(data) {
    return request({
        url: '/business/handleAccount',
        method: 'post',
        data: data
    })
}


//渠道修改·
export function supplierUpdate(data) {
    return request({
      url: '/business/stock/supplierUpdate',
      method: 'POST',
      data: data
    })
  }
  
// 修改
export function updateStock(data) {
    return request({
        url: '/business/handleAccount',
        method: 'put',
        data: data
    })
}

// 删除
export function delManagement(phoneId) {
    return request({
        url: '/business/handleAccount/' + phoneId,
        method: 'delete'
    })
}
//
export function count(query) {
    return request({
        url: '/business/handleAccount/count',
        method: 'get',
        params: query
    })
}
//
export function updateStatus(id, status,version) {
    return request({
        url: `/business/handleAccount/updateStatus/${id}/${status}/${version}`,
        method: 'get'
    })
}
// 一键上架
export function upandDownShelves(ids) {
    return request({
        url: `/business/handleAccount/listUpdateStatus/${ids}`,
        method: 'get',
    })
}

// 批量上架
export function bulkListings(data) {
  return request({
    url: `/business/automatic_shelves/bulk_listings`,
    method: 'post',
    data: data
  })
}

// 批量下架
export function bulkDelisting(data) {
  return request({
    url: `/business/automatic_shelves/bulk_delisting`,
    method: 'post',
    data: data
  })
}



export function getProgress(taskId) {
    return request({
        url: `/business/automatic_shelves/progress/${taskId}`,
        method: 'GET'
    })
}
